package com.localjoycommunity.cpdj.project.system.service.impl;

import java.util.List;
import com.localjoycommunity.cpdj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.localjoycommunity.cpdj.project.system.mapper.PartyBranchMapper;
import com.localjoycommunity.cpdj.project.system.domain.PartyBranch;
import com.localjoycommunity.cpdj.project.system.service.IPartyBranchService;

/**
 * 党支部Service业务层处理
 *
 * @author leepandar
 * @date 2020-11-04
 */
@Service
public class PartyBranchServiceImpl implements IPartyBranchService
{
    @Autowired
    private PartyBranchMapper partyBranchMapper;

    /**
     * 查询党支部
     *
     * @param id 党支部ID
     * @return 党支部
     */
    @Override
    public PartyBranch selectPartyBranchById(Long id)
    {
        return partyBranchMapper.selectPartyBranchById(id);
    }

    /**
     * 查询党支部列表
     *
     * @param partyBranch 党支部
     * @return 党支部
     */
    @Override
    public List<PartyBranch> selectPartyBranchList(PartyBranch partyBranch)
    {
        return partyBranchMapper.selectPartyBranchList(partyBranch);
    }

    /**
     * 新增党支部
     *
     * @param partyBranch 党支部
     * @return 结果
     */
    @Override
    public int insertPartyBranch(PartyBranch partyBranch)
    {
        partyBranch.setCreateTime(DateUtils.getNowDate());
        return partyBranchMapper.insertPartyBranch(partyBranch);
    }

    /**
     * 修改党支部
     *
     * @param partyBranch 党支部
     * @return 结果
     */
    @Override
    public int updatePartyBranch(PartyBranch partyBranch)
    {
        return partyBranchMapper.updatePartyBranch(partyBranch);
    }

    /**
     * 批量删除党支部
     *
     * @param ids 需要删除的党支部ID
     * @return 结果
     */
    @Override
    public int deletePartyBranchByIds(Long[] ids)
    {
        return partyBranchMapper.deletePartyBranchByIds(ids);
    }

    /**
     * 删除党支部信息
     *
     * @param id 党支部ID
     * @return 结果
     */
    @Override
    public int deletePartyBranchById(Long id)
    {
        return partyBranchMapper.deletePartyBranchById(id);
    }
}
